<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div></div>
    <script>
        // console.log(location.search); substr('起始位置', 截取几个字符) 第二个参数省略的话默认截到最后
        var search = location.search.substr(1); // 去除？
        var searchArr = search.split('='); // 分割字符串
        var div = document.querySelector('div');
        div.innerHTML = '登录的用户名：' + searchArr[1];
    </script>
</body>

</html>